%% The big picture
file = '/Users/ben/Desktop/Labs/Snow_Dots/docs/html/picture.html';
command = sprintf('open %s', file);
unix(command);



%% set up the dotris demo game
clear classes
clc
dm = dotsTheDrawablesManager.theObject;
dm.serverMode = true;
dm.clientMode = true;
s = dotsTheScreen.theObject;
s.displayRect = [1 1 640 480];
[tree, list] = configureDotris;

%% launch the game
topsDataLog.flushAllData;
tree.run

%% silly analysis of the game
% looks at data stored in topsTheDataLog and plots a summary of the
% player's behavior during the game
analyzeDotris;

%% summary of event timing
% plots dotris timstamps stored in topsTheDataLog
plotDotrisTiming;


%% loop gui for concurrent behaviors
loop = list{'control objects'}{'game loop'};
loop.gui;

%% block tree gui for borad flow
tree.gui;

%% a richer tree
[otherTree, otherList] = configureSpotsTasks;
otherTree.gui

%% list gui for all data
list.gui;

%% state machine gui for detailed flow
stateMachine = list{'control objects'}{'game machine'};
stateMachine.gui;

%% state machine graph
file = '/Users/ben/Desktop/datagraph/dotris/stateDiagram.png';
command = sprintf('open %s', file);
unix(command);



%% documentation
file = '/Users/ben/Desktop/Labs/Snow_Dots/docs/html/index.html';
command = sprintf('open %s', file);
unix(command);

%% unit tests
runAllTopsTests;
runAllDotsTests;

%% two projects
snowDotsURL = 'http://snow-dots.code.google.com';
topsURL = 'http://tower-of-psych.code.google.com';
